#include<stdio.h>

int main()
{
    int i, j;
    int M, N;
    int max, min, max_yueshu, min_beishu;
    scanf("%d %d",&M, &N);
    if(M>N)
    {
        max = M;
        min = N;
    }
    else
    {
        max = N;
        min = M;
    }
    for(i=max; i<=M*N; i++)
    {
        if(i%M == 0 && i%N == 0)
        {
            min_beishu = i;
            break;
        }
        min_beishu = M*N;
    }
    for(j=1; j<=min; j++)
    {
        if(M%j == 0 && N%j == 0)
        {
            max_yueshu = j;
        }
    }
    printf("%d %d",max_yueshu, min_beishu);
    
    return 0;
}